import { defineStore } from "pinia"
import type { AxiosInstance } from "axios"

type AppOptions = {
  axiosInstance: Partial<AxiosInstance>,
}
export const useAppStore = defineStore('app', {
  state: (): AppOptions => ({
    axiosInstance: {}
  }),
  getters: {
    getAxiosInstance(): AxiosInstance { return this.axiosInstance as AxiosInstance },
  },
  actions: {
    saveAxiosInstance(axiosInstance: AxiosInstance) {
      this.axiosInstance = axiosInstance
    },
  }
})
